﻿<template>
    <div class="container" style="width:99%;margin-top:-25px;">
        <!-- 查询条件 -->
        <div class="query-box">
            <el-form :model="queryBox" status-icon ref="queryBox">
                <div class="schoolBoxCont">
                    <div class="schoolBoxContItem">
                        <el-form-item label prop="name">
                            <div class="schoolBoxContItemTitle">学校名称</div>
                            <div class="schoolBoxContItemInput">
                                <el-input clearable v-model="queryBox.name" placeholder="学校名称"></el-input>
                            </div>
                        </el-form-item>
                    </div>
                    <div class="schoolBoxContItem">
                        <el-form-item label prop="name">
                            <div class="schoolBoxContItemTitle">联系人</div>
                            <div class="schoolBoxContItemInput">
                                <el-input clearable v-model="queryBox.contact" placeholder="联系人"></el-input>
                            </div>
                        </el-form-item>
                    </div>
                    <!-- <div class="schoolBoxContItem">
            <el-form-item label prop="name">
              <div class="schoolBoxContItemTitle">
                职位
              </div>
              <div class="schoolBoxContItemInput">
                <el-input
                  clearable
                  v-model="queryBox.duty"
                  placeholder="职位"
                >
                </el-input>
              </div>
            </el-form-item>
                    </div>-->
                    <div class="schoolBoxContItem">
                        <el-form-item label prop="name">
                            <div class="schoolBoxContItemTitle">联系电话</div>
                            <div class="schoolBoxContItemInput">
                                <el-input clearable v-model="queryBox.phone" placeholder="联系电话"></el-input>
                            </div>
                        </el-form-item>
                    </div>
                    <!-- <div class="schoolBoxContItem">
            <el-form-item label prop="name">
              <div class="schoolBoxContItemTitle">
                单位
              </div>
              <div class="schoolBoxContItemInput">
                <el-input
                  clearable
                  v-model="queryBox.company"
                  placeholder="联系电话"
                >
                </el-input>
              </div>
            </el-form-item>
                    </div>-->
                    <div class="schoolBoxContItem">
                        <el-form-item label prop="name">
                            <div class="schoolBoxContItemTitle">所在地区：</div>
                            <div class="schoolBoxContItemInput" style="width:300px">
                                <el-cascader
                                    clearable
                                    style="width:100% !important"
                                    size="large"
                                    :options="options"
                                    v-model="selectedOptions"
                                ></el-cascader>
                            </div>
                        </el-form-item>
                    </div>
                </div>
            </el-form>
            <div class="from-btns">
                <kt-button
                    :label="$t('action.reset')"
                    perms="true"
                    type="primary"
                    @click="reset('queryBox')"
                />
                <kt-button
                    :label="$t('action.search')"
                    perms="true"
                    type="primary"
                    @click="search"
                />
            </div>
        </div>

        <div class="add-btns fl">
            <kt-button
                :label="$t('action.batchdistribution')"
                :disabled="this.selections.length===0"
                :perms="btnBatchdistribution"
                type="primary"
                @click="handlebatchdistribution"
            />
            <!-- perms="directCampCenter:SchoolCustomerSea:batchdistribution" -->
        </div>
        <div class="fr">
            <!-- <kt-button
                label="新增"
                type="primary"
                perms="directCampCenter:SchoolCustomerSea:add"
                @click="handleNewADD"
            ></kt-button> -->
        </div>
        <!--表格内容栏-->
        <Crm-table
            class="table-width"
            SchoolCustomerSea2
            width="400"
            :data="pageResult"
            :columns="columns"
            :loading="loading"
            @findPage="findPage"
            @handleSee="handleSee"
            @selectionChange="selectionChange"
        ></Crm-table>

        <!--批量分配-->
        <div class="batchdistribution-pop">
            <el-dialog :visible.sync="batchdistribution" :close-on-click-modal="false" width="30%">
                <el-row>
                    <el-col :span="24">
                        <span class="batchdistribution-pop-tit">客户分配</span>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <span class="checked-person">已经选择{{selections.length}}位客户</span>
                    </el-col>
                </el-row>
                <el-form :inline="true" :model="addstuformData" class="demo-form-inline">
                    <el-row>
                        <el-col :span="24">
                            <el-row>
                                <el-col :span="6">
                                    <span class="tit">划分方式：</span>
                                </el-col>
                                <el-col :span="18">
                                    <el-select
                                        clearable
                                        v-model="deptmodeoptionsValue"
                                        placeholder="请选择"
                                        @change="deptmodeoptionsChange"
                                    >
                                        <el-option
                                            v-for="item in deptmodeoptions"
                                            :key="item.index"
                                            :label="item.label"
                                            :value="item.value"
                                        ></el-option>
                                    </el-select>
                                </el-col>
                            </el-row>
                        </el-col>
                    </el-row>
                    <!-- <el-row style="margin-top:5%" v-if="isShowFlag==1||isShowFlag==2">
            <el-col :span="24">
              <el-row>
                <el-col :span="6">
                  <span class="tit">选择部门：</span>
                </el-col>
                <el-col :span="18">
                  <popup-tree-input
                  :data="deptData"
                  :props="deptTree"
                  :prop="deptinputValue"
                  :currentChangeHandle="handleTreeSelectChange3Add"
                  ></popup-tree-input>
                </el-col>
              </el-row>
            </el-col>
                    </el-row>-->
                    <el-row style="margin-top:5%" v-if="isShowFlag==2">
                        <el-col :span="24">
                            <el-row>
                                <el-col :span="6">
                                    <span class="tit">人员选择：</span>
                                </el-col>
                                <el-col :span="18">
                                    <el-select
                                        clearable
                                        v-model="AllotData.belongToId"
                                        placeholder="请选择"
                                    >
                                        <el-option
                                            v-for="item in deptuseroption"
                                            :key="item.id"
                                            :label="item.realName"
                                            :value="item.id"
                                        ></el-option>
                                    </el-select>
                                </el-col>
                            </el-row>
                        </el-col>
                    </el-row>
                </el-form>

                <span slot="footer" class="dialog-footer">
                    <el-button @click="batchdistribution = false">取 消</el-button>
                    <!-- <el-button type="primary" @click="batchdistributionsubmit">确 定</el-button> -->
                    <el-button
                        type="primary"
                        v-if="isShowFlag==1"
                        @click="batchdistributionsubmitdept"
                    >确 定</el-button>
                    <el-button
                        type="primary"
                        v-if="isShowFlag==2"
                        @click="batchdistributionsubmituser"
                    >确 定</el-button>
                </span>
            </el-dialog>
        </div>
        <!-- 查看跟进 -->
        <!-- 报备 -->
        <el-dialog
            title="跟进情况"
            width="70%"
            :visible.sync="reportShow"
            :close-on-click-modal="false"
            class="pop"
        >
            <Crm-table
                seeSchoolTracking
                :showBatchDelete="showBatchDelete"
                class="tracking-table"
                :data="detailRecordInfoData"
                :columns="columns3"
                @handleSee="handleSee2"
                :loading="loading"
                :order="false"
            ></Crm-table>
        </el-dialog>
        <!-- 跟进详情 -->
        <el-dialog title="跟进详情" :visible.sync="dialogVisible" width="30%">
            <div class="trckingList">
                <ul>
                    <li v-for="item in rowData.recordPlans">
                        <span class="title">{{item.recordName}}</span>
                        :{{item.recordContent}}
                    </li>
                </ul>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
            </span>
        </el-dialog>
    </div>
</template>
<script>
import PopupTreeInput from "@/components/PopupTreeInput";
import KtButton from "@/views/Core/KtButton";
import CrmTable from "@/views/Core/CrmTable";
import CrmSwitch from "@/views/Core/CrmSwitch";
import { regionDataPlus } from "element-china-area-data";
import { CodeToText } from "element-china-area-data";
import { baseUrl } from "@/utils/global";
import axios from "axios";
import Cookies from "js-cookie";
export default {
    name: "Chinaedu",
    components: {
        PopupTreeInput,
        CrmTable,
        KtButton,
        CrmSwitch
    },
    data() {
        return {
            aa: true,
            checkedPeson: 0,
            size: "small",
            // filters: {
            //   name: ""
            // },
            // 查询条件
            student_data_from_options: [
                {
                    label: " ",
                    key: " "
                }
            ],
            student_type_options: [],
            showBatchDelete: false,
            student_progress_options: [
                {
                    label: " ",
                    key: " "
                }
            ],
            student_data_from_type_options: [
                {
                    label: " ",
                    key: " "
                }
            ],
            queryBox: {
                belongType: "4",
                customerSource: "",
                customerType: "",
                lastBelongPeople: "",
                allotType: "",
                customerProgress: ""
            },
            //   地区
            options: regionDataPlus,
            selectedOptions: [],
            width: 200,
            columns: [
                { type: "index", label: "序号", minWidth: 50 },
                { prop: "name", label: "学校名称", minWidth: 180 },
                { prop: "peopleNum", label: "学校人数", minWidth: 100 },
                { prop: "contact", label: "学校负责人", minWidth: 80 },
                { prop: "duty", label: "职位", minWidth: 80 },
                { prop: "phone", label: "手机", minWidth: 100 },
                { prop: "belongToName", label: "所属大区经理", minWidth: 100 },
                { prop: "lastbelongToName", label: "最后一次所属人", minWidth: 120 },
                {
                    prop: "thirdProportion",
                    label: "三方分成比例",
                    minWidth: 100
                },
                { prop: "thirdName", label: "三方姓名", minWidth: 100 },

                { prop: "thirdPhone", label: "三方手机", minWidth: 100 },
                {
                    prop: "thirdContractSignedDate",
                    label: "三方合同签署时间",
                    minWidth: 120
                },
                {
                    prop: "thirdContractEndDate",
                    label: "三方合同到期时间",
                    minWidth: 120
                },
                { prop: "paymentSituation", label: "回款情况", minWidth: 100 },
                { prop: "feastNum", label: "宴请次数", minWidth: 100 },
                { prop: "mettingNum", label: "参会次数", minWidth: 100 },
                { prop: "visitNum", label: "拜访次数", minWidth: 100 },
                { prop: "isRecord", label: "是否报备", minWidth: 100 },
                { prop: "auditStatusStr", label: "审核状态", minWidth: 100 },
                { prop: "diqu", label: "地区", minWidth: 190 },
                {
                    prop: "createDate",
                    sortable: "true",
                    label: "创建时间",
                    minWidth: 140
                }
            ],
            columns3: [
                { type: "index", label: "序号", minWidth: 10 },
                {
                    prop: "trackingDateStart",
                    label: "拜访/宴请/参会时间",
                    minWidth: 100
                },
                { prop: "recordType", label: "报备类别", minWidth: 100 }
            ],
            assigner: "",
            pageRequest: { pageNum: 1, pageSize: 10 },
            pageResult: {
                content: []
            },
            student_type_options: [],
            operation: true, // true:新增, false:编辑
            batchdistribution: false, //显示批量分配弹窗
            customerownership: false, //显示客户归属弹窗
            selectionsLength: "",
            deptTreeProps: {
                label: "name",
                children: "children"
            },
            roles: [],
            selections: [], //选中列表集合
            ids: [], //分配ID集合
            ids2: [],
            deptData: [], //部门树
            deptTree: {
                label: "deptName",
                children: "children"
            },
            deptinputValue: "",
            // 划分方式
            deptmodeoptions: [
                // {
                //   label: "分配至部门",
                //   value: "11"
                // },
                {
                    label: "分配至个人",
                    value: "9"
                }
            ],
            deptmodeoptionsValue: "",
            submitID: "",
            deptId: "",
            userID: "", //人员ID
            deptuseroption: [], //部门用户
            deptuseroptionValue: "",
            branchcenter: [], //分中心下拉
            branchcenterValue: "",
            branchcenterValueID: "",
            branchcenterCodeValue: "", //分中心编码
            addstuformData: {},
            student_type_options: [],
            trackingDate: "",
            createDate: "",
            loading: false,
            selections: [], //选中列表集合
            batchdistribution: false, //显示批量分配弹窗
            isShowFlag: 0, //0:初始化部门、人员不显示  1:部门显示 2：人员显示
            AllotData: {
                assignType: 2,
                schoolIds: "",
                thirdLevelDepartment: "",
                belongToId: "",
                belong_to_type: ""
            },
            dialogVisible: false,
            reportShow: false,
            rowData: [],
            recordData: {
                trackingDate: "",
                expectedClosingDate: ""
            },
            detailRecordInfoData: {
                content: []
            },
            school_recordType_options: [],
            pageRequest3: {
                pageNum: 1,
                pageSize: 10
            },
            btnBatchdistribution:''
        };
    },
    methods: {
        transformRouteBtnParam(){
            if(this.dataType&&this.dataType==2){
                this.btnBatchdistribution='directCampCenter:tz:SchoolCustomerSea:batchdistribution'
            }else{
                this.btnBatchdistribution='directCampCenter:SchoolCustomerSea:batchdistribution'
            }
        },
        // 搜索
        search() {
            this.loading = true;
            this.queryBox.province = this.selectedOptions[0];
            this.queryBox.city = this.selectedOptions[1];
            this.queryBox.area = this.selectedOptions[2];
            this.queryBox.createStartDate = this.createDate[0];
            this.queryBox.createStopDate = this.createDate[1];
            this.queryBox.trackingStartDate = this.trackingDate[0];
            this.queryBox.trackingStopDate = this.trackingDate[1];
            this.pageRequest.pageNum = 1;
            this.findPage(null);
        },
        // 获取分页数据
        findPage: function(data) {
            if (data !== null) {
                this.loading = true;
                this.pageRequest = data.pageRequest;
                this.pageRequest = Object.assign({}, this.pageRequest, {
                    belongType: "4"
                });
            }
            this.queryBox.pageSize = this.pageRequest.pageSize;
            this.queryBox.pageNum = this.pageRequest.pageNum;
            let dataType=''
            // 获取参数判断是否是商务拓展中心
            if(this.$route.fullPath.indexOf('dataType=2')>-1){
                dataType = 2;
            }
            if(dataType==2){
                this.queryBox.dataType=2
            }
            this.$api.school
                .gonghaiQuery(this.queryBox)
                .then(res => {
                    let content = {
                        content: res.listSchoolInfo,
                        totalSize: res.total
                    };
                    this.pageResult = content;
                    this.pageResult.content.forEach(item => {
                        item.isRecord == 1
                            ? (item.isRecord = "已报备")
                            : (item.isRecord = "未报备");
                        item.thirdProportion = item.thirdProportion + "%";
                        // 去掉时间的时分秒
                        item.thirdContractSignedDate = /\d{4}-\d{1,2}-\d{1,2}/g.exec(
                            item.thirdContractSignedDate
                        );
                        item.thirdContractEndDate = /\d{4}-\d{1,2}-\d{1,2}/g.exec(
                            item.thirdContractEndDate
                        );
                        if (
                            (item.province == null && item.city == null) ||
                            (item.province == "null" && item.city == "null")
                        ) {
                            item.diqu = "";
                        } else {
                            item.diqu =
                                (CodeToText[item.province] == undefined
                                    ? ""
                                    : CodeToText[item.province]) +
                                (CodeToText[item.city] == undefined
                                    ? ""
                                    : CodeToText[item.city]) +
                                (CodeToText[item.area] == undefined
                                    ? ""
                                    : CodeToText[item.area]);
                            // item.diqu = CodeToText[item.province] + CodeToText[item.city]+ CodeToText[item.area];
                        }
                        this.student_data_from_options.forEach(type_item => {
                            if (type_item.key == item.dataFrom) {
                                item.laiyuan = type_item.value;
                            }
                        });
                        this.student_progress_options.forEach(progress_item => {
                            if (progress_item.key == item.progress) {
                                item.getprogress = progress_item.value;
                            }
                        });
                        // 获取方式对应
                        this.student_data_from_type_options.forEach(
                            data_from_type_item => {
                                if (data_from_type_item.key == item.progress) {
                                    item.getType = data_from_type_item.value;
                                }
                            }
                        );
                        // 客户类型对应
                        this.student_type_options.forEach(student_type_item => {
                            if (student_type_item.key == item.type) {
                                item.type = student_type_item.value;
                            }
                        });
                    });
                    this.loading = false;
                })
                .then(data != null ? data.callback : "");
        },
        // 查询报备列表
        getData(data) {
            if (data !== null) {
                this.pageRequest3 = data.pageRequest;
            }

            this.$api.school
                .detailRecordInfo({
                    id: data.row.id,
                    pageSize: 1,
                    pageNum: 1
                })
                .then(res => {
                    let content = {
                        content: res.trackLists,
                        totalSize: res.total
                    };
                    this.detailRecordInfoData = content;
                    this.detailRecordInfoData.content.forEach(item => {
                        this.school_recordType_options.forEach(type_item => {
                            if (type_item.key == item.recordType) {
                                item.recordType = type_item.value;
                            }
                        });
                        item.trackingDateStart = /\d{4}-\d{1,2}-\d{1,2}/g.exec(
                            item.trackingDateStart
                        );
                    });
                })
                .then(data != null ? data.callback : "");
        },
        // 加载用户角色信息
        // findUserRoles: function() {
        //   this.$api.role.findAll().then(res => {
        //     // 加载角色集合
        //     this.roles = res.data;
        //   });
        // },
        // 重置
        reset(queryBox) {
            this.$refs.queryBox.resetFields();
            this.queryBox.phone = "";
            this.queryBox.name = "";
            this.queryBox.contact = "";
            this.queryBox.company = "";
            this.createDate = "";
            this.trackingDate = "";
            this.queryBox.allotType = "";
            this.queryBox.trackingStartDate = "";
            this.queryBox.trackingStopDate = "";
            this.queryBox.createStartDate = "";
            this.queryBox.province = "";
            this.queryBox.city = "";
            this.queryBox.area = "";
            this.queryBox.agentName = "";
            this.queryBox.createStopDate = "";
            this.queryBox.customerNumber = "";
            // this.queryBox.duty=''
            this.assigner = "";
            this.queryBox.lastBelongPeople = "";
            this.queryBox.belongTo = "";
            this.selectedOptions = [];
            this.pageRequest.pageNum = 1;
            this.findPage(null);
        },
        // 领取
        handleReceive(params) {
            this.$api.agent
                .getInternationalWatersCus({
                    customerId: params.row.id
                    // belongType: 9,
                    // belongTo:localStorage.getItem('userId')
                })
                .then(res => {
                    if (res.result == 2) {
                        this.$message({
                            message: res.msg,
                            type: "error"
                        });
                    } else if (res.result == 1) {
                        this.$message({
                            message: res.msg,
                            type: "success"
                        });
                        this.findPage(null);
                    }
                });
        },
        // 新增客户
        handleNewADD: function() {
            this.$router.push({
                path: "/Customerfile/AddSchool",
                query: {
                    createType: "13"
                }
            });
        },
        // 获取来源
        get_student_data_from() {
            this.student_data_from_options = JSON.parse(
                localStorage.getItem("investmentSource")
            );
        },
        get_student_progress() {
            this.student_progress_options = JSON.parse(
                localStorage.getItem("investmentProgress")
            );
        },
        student_progress_change(value) {
            this.queryBox.student_progressValue = value.toString();
        },
        get_student_type() {
            this.student_type_options = JSON.parse(
                localStorage.getItem("investmentType")
            );
        },
        get_student_data_from_type() {
            this.student_data_from_type_options = JSON.parse(
                localStorage.getItem("investmentDataFromType")
            );
        },
        student_parent_type_change(value) {
            this.info.studentInfoDetail.studentInfoAttr.parentType = value.toString();
        },

        selectionChange: function(params) {
            let selectionsLength = params.selections.length;
            this.selections = selections.selections;
        },
        // 获取选中的表格数据
        selectionChange: function(selections) {
            this.selections = selections.selections;
        },

        //划分方式 控制部门人员显示
        deptmodeoptionsChange(value) {
            if (value == 9) {
                this.isShowFlag = 2;
                this.AllotData.belong_to_type = 1; //个人
                this.AllotData.thirdLevelDepartment = 0; //清空
            } else if (value == 11) {
                this.isShowFlag = 1;
                this.AllotData.belong_to_type = 2; //部门
                this.AllotData.belongToId = 0;
            } else {
                this.isShowFlag = 0;
            }
        },

        // // 点击部门
        // handleTreeSelectChange3Add(data, node) {
        //   this.deptinputValue = data.deptName;
        //   this.deptuseroptionValue=''
        //   this.deptId = data.id;
        //   this.get_dept_user();
        // },
        // // 点击部门
        // handleTreeSelectChange3Add(data, node) {
        //   this.deptinputValue = data.deptName;
        //   this.deptuseroptionValue=''
        //   this.deptId = data.id;
        //   this.get_dept_user();
        // },
        // 点击部门
        handleTreeSelectChange3Add(data, node) {
            this.deptinputValue = data.deptName;
            this.deptId = data.id;
            this.AllotData.thirdLevelDepartment = data.id;
            this.AllotData.belongToId = "";
            this.get_dept_user();
        },

        // 获取部门用户
        get_dept_user() {
            // this.$api.dropdown.users({userType:3,threeLevelDeptId:this.deptId,accountStatus:1}).then(res =>{
            //     this.deptuseroption=res.userInfoList
            //   })
            let dataType=''
            // 获取参数判断是否是商务拓展中心
            if(this.$route.fullPath.indexOf('dataType=2')>-1){
                dataType=2
            }
            this.$api.dropdown
                .users({
                    userType: 3,
                    deptType: dataType==2?5:4,
                    accountStatus: 1,
                    isControlResource: 1,
                    twoLevelDeptId:dataType//如果是商务拓展中心 新增二级部门ID参数查询
                })
                .then(res => {
                    if (res.result == 1) {
                        this.deptuseroption = res.userInfoList;
                    }
                });
        },
        deptuserchange(value) {
            this.userID = value;
        },

        // 批量分配
        handlebatchdistribution(params) {
            this.batchdistribution = true;
            this.ids = [];
            let idstu = this.selections.map(item => item.id);
            this.ids = idstu;
            this.deptmodeoptionsValue = "";
            this.deptinputValue = "";
            this.deptuseroptionValue = "";
            this.isShowFlag = 0;
            this.AllotData.belongToId = "";
            this.get_dept_user();
        },

        // 批量分配提交
        batchdistributionsubmit() {
            this.AllotData.schoolIds = this.ids;
            this.$api.school.schoolAssign(this.AllotData).then(res => {
                if (res.result === 1) {
                    this.$message({ message: res.msg, type: "success" });
                    this.batchdistribution = false;
                    this.findPage(null);
                } else {
                    this.batchdistribution = false;
                    this.$message({ message: res.msg, type: "error" });
                }
            });
        },
        // 批量分配提交分配到部门
        batchdistributionsubmitdept() {
            this.AllotData.schoolIds = this.ids;
            this.$api.school.schoolAssign(this.AllotData).then(res => {
                if (res.result === 1) {
                    this.$message({ message: res.msg, type: "success" });
                    this.batchdistribution = false;
                    this.findPage(null);
                } else {
                    this.batchdistribution = false;
                    this.$message({ message: res.msg, type: "error" });
                }
            });
        },
        batchdistributionsubmituser() {
            this.AllotData.schoolIds = this.ids;
            this.$api.school.schoolAssign(this.AllotData).then(res => {
                if (res.result === 1) {
                    this.$message({ message: res.msg, type: "success" });
                    this.batchdistribution = false;
                    this.findPage(null);
                } else {
                    this.$message({ message: res.msg, type: "error" });
                }
            });
        },

        // 获取部门数据
        get_dept_data() {
            //deptType:1 部门类型 1 学生 2 学酷 3 网校 4 学校
            this.$api.dropdown.deptLevel3({ deptType: 4 }).then(res => {
                this.deptData = res.departmentInfoList;
            });
        },

        // 销售人员远程搜索
        querySearchAsync2(queryString, callback) {
            let restaurants = [{}];
            let results = "";
            // let threeId=JSON.parse(Cookies.get("threeLevelDeptId"))
            let threeId = JSON.parse(Cookies.get("threeLevelDeptId"));
            if (threeId == null) {
                this.$api.dropdown
                    .users({ userType: 3, deptType: 3 })
                    .then(res => {
                        for (let i of res.userInfoList) {
                            i.value = i.realName; //将想要展示的数据作为value
                        }
                        restaurants = res.userInfoList;
                        results = queryString
                            ? restaurants.filter(
                                  this.createFilter2(queryString)
                              )
                            : restaurants;
                        callback(results);
                    });
            } else {
                this.$api.dropdown
                    .users({
                        userType: 3,
                        deptType: 3,
                        threeLevelDeptId: this.deptId
                    })
                    .then(res => {
                        for (let i of res.userInfoList) {
                            i.value = i.realName; //将想要展示的数据作为value
                        }
                        restaurants = res.userInfoList;
                        results = queryString
                            ? restaurants.filter(
                                  this.createFilter2(queryString)
                              )
                            : restaurants;
                        callback(results);
                    });
            }
        },
        createFilter2(queryString) {
            return restaurant => {
                return (
                    restaurant.realName
                        .toLowerCase()
                        .indexOf(queryString.toLowerCase()) === 0
                );
            };
        },
        handleSelect2(item) {
            this.queryBox.lastBelongPeople = item.id;
        },
        handleClearable(value) {
            if (this.assigner == "") {
                this.queryBox.lastBelongPeople = "";
            }
        },
        handleSee(params) {
            this.reportShow = true;
            this.recordData.schoolId = params.row.id;
            this.schoolVisitType();
            this.getData(params)
        },
        schoolVisitType() {
            // this.$api.dropdown.schoolVisitType().then(res => {
            //   this.school_recordType_options = res.keyValueList;
            // });
            this.school_recordType_options = JSON.parse(
                localStorage.getItem("schoolRecordTypeOptions")
            );
        },
        handleSee2(params) {
            this.dialogVisible = true;
            this.rowData = params.row;
        }
    },
    mounted() {
        this.transformRouteBtnParam()
        this.get_dept_data();
        this.get_student_data_from();
        this.get_student_progress();
        this.get_student_type();
        this.get_student_data_from_type();
    }
};
</script>
<style >
@import url("../../assets/queryBox.css");
</style>
<style lang='scss' scoped>
.trckingList {
    ul {
        padding-left: 0;
        li {
            list-style: none;
            text-align: left;
            line-height: 30px;
            .title {
                font-weight: bold;
            }
        }
    }
}
.checked-person {
    font-weight: 500;
    display: inline-block;
    text-align: center;
    margin: 3% 0 3% 0;
}
.batchdistribution-pop-tit {
    font-size: 20px;
    font-weight: bold;
    display: inline-block;
    color: #303133;
}
.add-btns .el-button:nth-child(1) {
    margin-right: 10px;
}

.el-dialog__wrapper .el-form-item__content {
    margin-left: 0;
}
.demo-form-inline {
    width: 90%;
    margin: 0 auto;
    .el-dialog__body .el-input {
        width: 93% !important;
    }
    .el-select {
        width: 100% !important;
    }
    .tit {
        display: inline-block;
        margin-top: 10%;
    }
}
.el-row .el-col {
    margin-left: 0;
}
.add-btns .el-button:nth-child(1) {
    margin-right: 10px;
}
.second-contain-box {
    width: 95%;
    margin: 0 auto;
    .el-col {
        text-align: left;
        margin: 4px 0;
    }
    .el-row {
        margin: 0 0 !important;
    }
    .el-col i {
        font-style: normal;
        display: inline-block;
        // margin-top: 10%;
    }
}
.schoolBoxCont {
    margin: 5px 5px;

    .schoolBoxContItem {
        margin-right: 10px;
        float: left;
        .el-form-item__content {
            display: flex;
            flex-direction: row;
        }
        .schoolBoxContItemTitle {
            background: #f5f7fa;
            width: 115px;
            border: 1px solid #dcdfe6;
            border-top-left-radius: 4px;
            border-bottom-left-radius: 4px;
            line-height: 39px;
            border-right: none;
            float: left;
        }
        .schoolBoxContItemInput {
            width: 150px;
            line-height: 39px;
            float: left;
            .el-date-editor.el-input,
            .el-date-editor.el-input__inner {
                width: 100%;
            }
        }
    }
}
</style>
<style lang='scss'>
.batchdistribution-pop .el-dialog__header {
    padding: 0 0 0 0 !important;
}
</style>

